<?php
    include 'base.php';
    
    $a = $_GET['a'];
    $b = $_GET['b'];
    // $a = 1;
    // $b = 12;

    $sql = "SELECT * FROM `goods` LIMIT $a, $b";

    $res = $conn->query($sql);

    $arr = Array();

    while ($row = mysqli_fetch_assoc($res)) {
        array_push($arr, $row);
    }
    // echo $row;

    echo json_encode($arr);
?>